using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

namespace WsdlStudioLibrary.Windows.Controls.GotDotNetWebServiceStudioGui
{
    public partial class MainControl : UserControl
    {
        WSDynamicProxy.DynamicProxy wsDynamicProxy = null;
        WCFDynamicProxy.DynamicProxy wcfDynamicProxy = null;

        public MainControl()
        {
            InitializeComponent();

           
            //wcfDynamicProxy = new WCFDynamicProxy.DynamicProxy(
        }

        private void btnGet_Click(object sender, EventArgs e)
        {
            messagesControl1.Clear();

            wsDynamicProxy = new WSDynamicProxy.DynamicProxy(new Uri(cbxUrl.Text));
            wsDynamicProxy.NewMessage += new WSDynamicProxy.DynamicProxy.NewMessageDelegate(wsDynamicProxy_NewMessage);
            
            MethodInfo[] methodInfo = wsDynamicProxy.GetWebMethods();

            messagesControl1.UpdateMessagesControl("Ready To Invoke", WSDynamicProxy.DynamicProxy.Severity.Finished);

            requestResponseControl1.SetWsdl(wsDynamicProxy.ServiceDesc);
        }

        void wsDynamicProxy_NewMessage(string message, WSDynamicProxy.DynamicProxy.Severity severityInfo)
        {
            messagesControl1.UpdateMessagesControl(message, severityInfo);
        }
 
        #region PopulateWsdlProxyControl
        private void PopulateWsdlProxyControl()
        {

        }        
        #endregion

        #region PopulateRequestResponseControl
        private void PopulateRequestResponseControl()
        {

        } 
        #endregion

        #region PopulateInvokeControl
        private void PopulateInvokeControl()
        {

        } 
        #endregion

         
    }
}
